import os
import json

json_path1 = 'D:/PycharmProjects/three_source_json_data/39/json_data/'
json_path2 = 'D:/PycharmProjects/three_source_json_data/pingan/json_data/'
json_path3 = 'D:/PycharmProjects/three_source_json_data/xywy/json_data/'

i = 1
for i in range(len(os.listdir(json_path1))):
    print(i + 1)
    # filename = os.listdir(json_path3)[i]
    filename = 'xhdbeb.json'
    file_path = os.path.join(json_path1, filename)
    with open(file_path, mode='r', encoding='utf-8') as f:
        json_data = json.load(f)
    json_data['source'] = '39'
    # print(json_data)

    with open(file_path, mode='w', encoding='utf-8') as f2:
        json.dump(json_data, f2, ensure_ascii=False)
    i = i + 1
    break
